#ifndef BigInt_H

	#define BigInt_H
	#include <iostream>
	#include <string> 
	#include <algorithm>
	class BigInt
	{
	private:
		size_t  virSize;
		size_t  realSize;
		int*    digArray;
		bool    sign;
		
		void Reverse();
		
	public:
		explicit BigInt();
		BigInt(BigInt const & bigNum);
		BigInt(int num);
		~BigInt();
		
		size_t RealSize() const;	
		
		void Swap(BigInt& b);
		bool GetSign() const;
		void SetSign(bool f);
		void Push(int num);
		int  Pop();
		void Clear();
		
		int    & operator [](size_t x) const;
		BigInt & operator  =(BigInt const& bigNum);
		BigInt & operator +=(BigInt const& bigNum);
		BigInt & operator -=(BigInt const& bigNum);
		BigInt & operator *=(BigInt const& bigNum);
		friend BigInt operator /(BigInt const & bigNumA, BigInt const & bigNumB);
	};
	void        StrToBigInt(std::string const & s, BigInt & num);
	std::string BigIntToStr(BigInt const& num);
	
	bool   operator <(BigInt const &  bigNumA, BigInt const & bigNumB); 
	bool   operator >(BigInt const &  bigNumA, BigInt const & bigNumB);
	bool   operator <=(BigInt const &  bigNumA, BigInt const & bigNumB); 
	bool   operator >=(BigInt const &  bigNumA, BigInt const & bigNumB); 
	bool   operator ==(BigInt const &  bigNumA, BigInt const & bigNumB); 
	bool   operator !=(BigInt const &  bigNumA, BigInt const & bigNumB); 
	
	BigInt operator -(BigInt const & bigNumA);
	BigInt operator +(BigInt const & bigNumA, BigInt const & bigNumB);
	BigInt operator -(BigInt const & bigNumA, BigInt const & bigNumB);
	BigInt operator *(BigInt const & bigNumA, BigInt const & bigNumB);
	BigInt operator /(BigInt const & bigNumA, BigInt const & bigNumB);
	
	std::ostream & operator <<(std::ostream & out, BigInt const & bigNum);
	std::istream & operator >>(std::istream & in, BigInt & bigNum);
#endif